package com.swyc.osschat.Test.designMode.command.dto;

import com.swyc.osschat.Test.designMode.command.base.Command;

/**
 * @description 请求者角色：遥控器
 * @Author: z156940l@outlook.com
 * @className RemoteControl
 * @Date: 2022/7/21 17:21
 */
public class RemoteControl {
    private Command onTvCommand;
    private Command offTvCommand;

    public RemoteControl(Command onTvCommand, Command offTvCommand) {
        this.onTvCommand = onTvCommand;
        this.offTvCommand = offTvCommand;
    }

    //打开
    public void clickOn(){
        onTvCommand.execute();
    }

    //关闭
    public void clickOff(){
        offTvCommand.execute();
    }
}